import { Body, Controller, Get, Post } from "@nestjs/common";
import { UserService } from './user.service';
import { UserDto } from './user.dto';
import { Public } from 'src/auth/public.decorator';

@Controller('/user')
export class UserController {
  constructor(private  readonly registerService: UserService) {}
  @Public()
  @Post('/register')
  async register(@Body() userDto: UserDto){
    return this.registerService.register(userDto)
  }
  @Public()
  @Post('/login')
  async login(@Body() userDto: UserDto){
    return this.registerService.login(userDto)
  }
}